﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace TodoApp.Repositories.Contract
{
    public interface IRepository<TEntity> where TEntity : class
    {
        TEntity Get(ValueType id);
        IList<TEntity> GetAll();
        TEntity FindOne(Expression<Func<TEntity, bool>> expression);
        IList<TEntity> Find(Expression<Func<TEntity, bool>> expression);
        IList<TEntity> Find(out int totalRecords, int pageSize, int pageIndex, Expression<Func<TEntity, bool>> expression = null);
        void Add(TEntity entity);        
        void Delete(TEntity entity);
    }
}
